<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>File Source for BuanExtension.php</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">Buan<br /><div class="header-top-right-subpackage"></div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                        
                      		[ <a href="../classtrees_Buan.html" class="menu">class tree: Buan</a> ]
		[ <a href="../elementindex_Buan.html" class="menu">index: Buan</a> ]
            [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">Buan</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_Buan.html">Buan</a><br />
      	</div>
      <br />
                        <br />
                      </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file BuanExtension.php</h1>
<p>Documentation is available at <a href="../Buan/_BuanExtension.php.html">BuanExtension.php</a></p>
<div class="src-code"><span class="php">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;Buan</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">*/</span></div></li>
<li><div class="src-line"><a name="a5"></a>namespace&nbsp;<span class="src-id">Buan</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-key">abstract&nbsp;</span><span class="src-key">class&nbsp;</span><a href="../Buan/Extension.html">Extension</a>&nbsp;<span class="src-key">extends&nbsp;</span><a href="../Buan/Object.html">Object</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a7"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a8"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@property&nbsp;string&nbsp;$name</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Extension&nbsp;name&nbsp;(matches&nbsp;name&nbsp;of&nbsp;the&nbsp;folder&nbsp;in&nbsp;which&nbsp;the&nbsp;extension&nbsp;is&nbsp;stored)</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a12"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../Buan/Extension.html#var$name">$name</a>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a13"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@property&nbsp;string&nbsp;$title</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Extension&nbsp;title</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;[USER-DEFINED]</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a19"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../Buan/Extension.html#var$title">$title</a>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a20"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@property&nbsp;string&nbsp;$description</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Extension&nbsp;description</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;[USER-DEFINED]</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a26"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../Buan/Extension.html#var$description">$description</a>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a28"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@property&nbsp;array&nbsp;$dependancies</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Extension&nbsp;dependancies</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;[USER-DEFINED]</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../Buan/Extension.html#var$dependancies">$dependancies</a>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@property&nbsp;string&nbsp;$version</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Extension&nbsp;version</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;[USER-DEFINED]</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../Buan/Extension.html#var$version">$version</a>&nbsp;=&nbsp;<span class="src-str">&quot;0&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;Extension&nbsp;__construct(&nbsp;string&nbsp;$name,&nbsp;string&nbsp;$namespace&nbsp;)</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;$name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;Name&nbsp;of&nbsp;this&nbsp;Extension</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;$namespace&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;Location&nbsp;of&nbsp;this&nbsp;extension&nbsp;(app&nbsp;|&nbsp;core)</span></div></li>
<li><div class="src-line"><a name="a46"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Do&nbsp;NOT&nbsp;call&nbsp;this&nbsp;constructor&nbsp;directly.&nbsp;Use&nbsp;::getExtendionByName()&nbsp;instead.</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;The&nbsp;following&nbsp;Config&nbsp;variables&nbsp;are&nbsp;set&nbsp;automatically:</span></div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;ext.*.docRoot</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;ext.*.urlRoot</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$namespace</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Store&nbsp;properties</span></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#var$name">name</a>&nbsp;=&nbsp;<span class="src-var">$name</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Create&nbsp;some&nbsp;config&nbsp;settings&nbsp;in&nbsp;the&nbsp;[ext.*]&nbsp;namespace</span></div></li>
<li><div class="src-line"><a name="a59"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$config&nbsp;</span>=&nbsp;<span class="src-id"><a href="../Buan/Config.html">Config</a></span><span class="src-sym">::</span><a href="../Buan/Config.html#methodget">get</a><span class="src-sym">(</span><span class="src-var">$namespace</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a60"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../Buan/Config.html">Config</a></span><span class="src-sym">::</span><a href="../Buan/Config.html#methodset">set</a><span class="src-sym">(</span><span class="src-str">'ext.'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#var$name">name</a>.<span class="src-str">'.docRoot'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$config</span><span class="src-sym">[</span><span class="src-str">'dir'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'extensions'</span><span class="src-sym">]</span>.<span class="src-str">'/'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#var$name">name</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">&quot;/&quot;</span>.<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$config</span><span class="src-sym">[</span><span class="src-str">'docRoot'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;/&quot;</span><span class="src-sym">)</span>.<span class="src-str">&quot;/i&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$config</span><span class="src-sym">[</span><span class="src-str">'dir'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'extensions'</span><span class="src-sym">]</span><span class="src-sym">)</span>&gt;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a62"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$urlRoot&nbsp;</span>=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">&quot;/&quot;</span>.<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$config</span><span class="src-sym">[</span><span class="src-str">'docRoot'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;/&quot;</span><span class="src-sym">)</span>.<span class="src-str">&quot;/i&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$config</span><span class="src-sym">[</span><span class="src-str">'dir'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'extensions'</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">'/'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#var$name">name</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a63"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../Buan/Config.html">Config</a></span><span class="src-sym">::</span><a href="../Buan/Config.html#methodset">set</a><span class="src-sym">(</span><span class="src-str">'ext.'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#var$name">name</a>.<span class="src-str">'.urlRoot'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\\&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;/&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$urlRoot</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a64"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../Buan/Config.html">Config</a></span><span class="src-sym">::</span><a href="../Buan/Config.html#methodset">set</a><span class="src-sym">(</span><span class="src-str">'ext.'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#var$name">name</a>.<span class="src-str">'.urlRoot'</span><span class="src-sym">,&nbsp;</span><span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a68"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a71"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;array&nbsp;getAvailableList()</span></div></li>
<li><div class="src-line"><a name="a72"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a73"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;Extension&nbsp;objects&nbsp;that&nbsp;are&nbsp;available&nbsp;to&nbsp;the&nbsp;current</span></div></li>
<li><div class="src-line"><a name="a74"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;application.&nbsp;This&nbsp;includes&nbsp;all&nbsp;extensions&nbsp;listed&nbsp;in&nbsp;both&nbsp;the&nbsp;core</span></div></li>
<li><div class="src-line"><a name="a75"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;extensions&nbsp;folder&nbsp;and&nbsp;the&nbsp;application's&nbsp;extension&nbsp;folder.</span></div></li>
<li><div class="src-line"><a name="a76"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">final&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodgetAvailableList">getAvailableList</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a78"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a79"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Gather&nbsp;extensions&nbsp;from&nbsp;both&nbsp;the&nbsp;'core'&nbsp;and&nbsp;'application'&nbsp;folders</span></div></li>
<li><div class="src-line"><a name="a80"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extensions&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extFolders&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-id"><a href="../Buan/Config.html">Config</a></span><span class="src-sym">::</span><a href="../Buan/Config.html#methodget">get</a><span class="src-sym">(</span><span class="src-str">'app.dir.extensions'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../Buan/Config.html">Config</a></span><span class="src-sym">::</span><a href="../Buan/Config.html#methodget">get</a><span class="src-sym">(</span><span class="src-str">'core.dir.extensions'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$extFolders&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$extFolder</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Ignore&nbsp;invalid&nbsp;folders</span></div></li>
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$extFolder</span>==<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Iterate&nbsp;through&nbsp;folder</span></div></li>
<li><div class="src-line"><a name="a90"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dir&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span>\<span class="src-id">DirectoryIterator</span><span class="src-sym">(</span><span class="src-var">$extFolder</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a92"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$dir&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$obj</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Ignore&nbsp;parent&nbsp;paths&nbsp;and&nbsp;non-directories</span></div></li>
<li><div class="src-line"><a name="a95"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$obj</span><span class="src-sym">-&gt;</span><span class="src-id">isDot</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>||&nbsp;<span class="src-sym">!</span><span class="src-var">$obj</span><span class="src-sym">-&gt;</span><span class="src-id">isDir</span><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a96"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a97"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a98"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a99"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Get&nbsp;the&nbsp;Extension&nbsp;instance</span></div></li>
<li><div class="src-line"><a name="a100"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extName&nbsp;</span>=&nbsp;<span class="src-var">$obj</span><span class="src-sym">-&gt;</span><span class="src-id">getFileName</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ext&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">getExtensionByName</span><span class="src-sym">(</span><span class="src-var">$extName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$ext</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extensions</span><span class="src-sym">[</span><span class="src-var">$extName</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$ext</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a105"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch<span class="src-sym">(</span><span class="src-id"><a href="../Buan/Exception.html">Exception</a>&nbsp;</span><span class="src-var">$e</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../Buan/SystemLog.html">SystemLog</a></span><span class="src-sym">::</span><a href="../Buan/SystemLog.html#methodadd">add</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Failed&nbsp;to&nbsp;open&nbsp;{<span class="src-var">$extFolder</span><span class="src-sym">}</span>&nbsp;for&nbsp;parsing.</span><span class="src-str">&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../Buan/SystemLog.html">SystemLog</a></span><span class="src-sym">::</span><span class="src-id">WARNING</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a109"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a110"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a111"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a112"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Result</span></div></li>
<li><div class="src-line"><a name="a113"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$extensions</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a114"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a115"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a117"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;Extension&nbsp;getExtensionByName(&nbsp;string&nbsp;$extName&nbsp;)</span></div></li>
<li><div class="src-line"><a name="a118"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;$extName&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;Extension&nbsp;name&nbsp;(ie.&nbsp;name&nbsp;of&nbsp;the&nbsp;extension's&nbsp;folder)</span></div></li>
<li><div class="src-line"><a name="a119"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a120"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Returns&nbsp;an&nbsp;Extension&nbsp;instance&nbsp;that&nbsp;corresponds&nbsp;to&nbsp;the&nbsp;specified&nbsp;extension.</span></div></li>
<li><div class="src-line"><a name="a121"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a122"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">final&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodgetExtensionByName">getExtensionByName</a><span class="src-sym">(</span><span class="src-var">$extName</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a123"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a124"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Vars</span></div></li>
<li><div class="src-line"><a name="a125"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extClassName&nbsp;</span>=&nbsp;<span class="src-id"><a href="../Buan/Inflector.html">Inflector</a></span><span class="src-sym">::</span><a href="../Buan/Inflector.html#methodextensionName_extensionClass">extensionName_extensionClass</a><span class="src-sym">(</span><span class="src-var">$extName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a126"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-var">$extensions&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a127"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$extensions</span><span class="src-sym">[</span><span class="src-var">$extName</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a128"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$extensions</span><span class="src-sym">[</span><span class="src-var">$extName</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a129"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Find&nbsp;the&nbsp;extension</span></div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Extensions&nbsp;in&nbsp;&quot;app&quot;&nbsp;will&nbsp;override&nbsp;the&nbsp;same&nbsp;extension&nbsp;in&nbsp;&quot;core&quot;.</span></div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extFolders&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'app'</span>=&gt;<a href="../Buan/Config.html">Config</a><span class="src-sym">::</span><span class="src-id">get</span><span class="src-sym">(</span><span class="src-str">'app.dir.extensions'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-str">'core'</span>=&gt;<a href="../Buan/Config.html">Config</a><span class="src-sym">::</span><span class="src-id">get</span><span class="src-sym">(</span><span class="src-str">'core.dir.extensions'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$extFolders&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$namespace</span>=&gt;<span class="src-var">$extFolder</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$extFolder</span>==<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-sym">!</span><span class="src-id">file_exists</span><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-var">$extFolder</span>/<span class="src-var">$extName</span><span class="src-str">&quot;</span><span class="src-sym">)&nbsp;</span>||&nbsp;<span class="src-id">in_array</span><span class="src-sym">(</span><span class="src-var">$extName</span><span class="src-sym">,&nbsp;</span><a href="../Buan/Config.html">Config</a><span class="src-sym">::</span><span class="src-id">get</span><span class="src-sym">(</span><span class="src-str">'app.dir.ignored'</span><span class="src-sym">)))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a136"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a137"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a138"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_file">is_file</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$extFolder</span>/<span class="src-var">$extName</span>/<span class="src-var">$extClassName</span>.php</span><span class="src-str">&quot;</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a139"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../Buan/SystemLog.html">SystemLog</a></span><span class="src-sym">::</span><a href="../Buan/SystemLog.html#methodadd">add</a><span class="src-sym">(</span><span class="src-str">'Extension&nbsp;&quot;'</span>.<span class="src-var">$extName</span>.<span class="src-str">'&quot;&nbsp;is&nbsp;missing&nbsp;a&nbsp;class&nbsp;definition.'</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../Buan/SystemLog.html">SystemLog</a></span><span class="src-sym">::</span><span class="src-id">WARNING</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a140"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a141"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$extensions</span><span class="src-sym">[</span><span class="src-var">$extName</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a142"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-var">$extFolder</span>/<span class="src-var">$extName</span>/<span class="src-var">$extClassName</span>.php<span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a143"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ext&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-var">$extClassName</span><span class="src-sym">(</span><span class="src-var">$extName</span><span class="src-sym">,&nbsp;</span><span class="src-var">$namespace</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a144"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extensions</span><span class="src-sym">[</span><span class="src-var">$extName</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$ext</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a145"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a146"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Result</span></div></li>
<li><div class="src-line"><a name="a149"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span>isset<span class="src-sym">(</span><span class="src-var">$extensions</span><span class="src-sym">[</span><span class="src-var">$extName</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-var">$extensions</span><span class="src-sym">[</span><span class="src-var">$extName</span><span class="src-sym">]&nbsp;</span>:&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a153"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;bool&nbsp;validateDependancies()</span></div></li>
<li><div class="src-line"><a name="a154"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a155"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Checks&nbsp;that&nbsp;all&nbsp;dependancies&nbsp;are&nbsp;installed.</span></div></li>
<li><div class="src-line"><a name="a156"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a157"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">final&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodvalidateDependancies">validateDependancies</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a158"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Go&nbsp;through&nbsp;all&nbsp;dependancies&nbsp;and&nbsp;check&nbsp;they&nbsp;are&nbsp;installed</span></div></li>
<li><div class="src-line"><a name="a160"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$validated&nbsp;</span>=&nbsp;<span class="src-id">TRUE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a161"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../Buan/Extension.html#var$dependancies">dependancies</a>&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$dependancy</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a162"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$E&nbsp;</span>=&nbsp;<span class="src-id"><a href="../Buan/Extension.html">Extension</a></span><span class="src-sym">::</span><a href="../Buan/Extension.html#methodgetExtensionByName">getExtensionByName</a><span class="src-sym">(</span><span class="src-var">$dependancy</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a163"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$E</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#methodisInstalled">isInstalled</a><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$validated&nbsp;</span>=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a168"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Result</span></div></li>
<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$validated</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a170"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a173"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;array&nbsp;getDependants(&nbsp;[bool&nbsp;$isInstalled]&nbsp;)</span></div></li>
<li><div class="src-line"><a name="a174"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;$isInstalled&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;Results&nbsp;flag</span></div></li>
<li><div class="src-line"><a name="a175"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a176"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Returns&nbsp;an&nbsp;array&nbsp;of&nbsp;Extension&nbsp;instances&nbsp;that&nbsp;are&nbsp;dependant&nbsp;on&nbsp;$this&nbsp;Extension.</span></div></li>
<li><div class="src-line"><a name="a177"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;If&nbsp;$isInstalled===TRUE&nbsp;then&nbsp;installed&nbsp;ones&nbsp;are&nbsp;returned.</span></div></li>
<li><div class="src-line"><a name="a178"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;If&nbsp;$isInstaleld===FALSE&nbsp;then&nbsp;non-installed&nbsp;ones&nbsp;are&nbsp;returned.</span></div></li>
<li><div class="src-line"><a name="a179"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;If&nbsp;$isInstalled===NULL&nbsp;then&nbsp;ALL&nbsp;are&nbsp;returned.</span></div></li>
<li><div class="src-line"><a name="a180"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">final&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodgetDependants">getDependants</a><span class="src-sym">(</span><span class="src-var">$isInstalled</span>=<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Find&nbsp;all&nbsp;extensions&nbsp;which&nbsp;depend&nbsp;on&nbsp;$this&nbsp;Extension</span></div></li>
<li><div class="src-line"><a name="a184"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dependants&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a185"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extensions&nbsp;</span>=&nbsp;<span class="src-id"><a href="../Buan/Extension.html">Extension</a></span><span class="src-sym">::</span><a href="../Buan/Extension.html#methodgetAvailableList">getAvailableList</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a186"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$extensions&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$extension</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a187"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../Buan/Extension.html#var$name">name</a></span><span class="src-sym">,&nbsp;</span><span class="src-var">$extension</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../Buan/Extension.html#var$dependancies">dependancies</a></span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a188"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$isInstalled</span>===<span class="src-id">TRUE</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a189"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$extension</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#methodisInstalled">isInstalled</a><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a190"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dependants</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$extension</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$isInstalled</span>===<span class="src-id">FALSE</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a194"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$extension</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#methodisInstalled">isInstalled</a><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dependants</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$extension</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a196"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a197"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a198"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dependants</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$extension</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a202"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a203"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a204"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Result</span></div></li>
<li><div class="src-line"><a name="a205"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$dependants</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a206"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a207"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a208"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a209"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;bool&nbsp;initDependancies()</span></div></li>
<li><div class="src-line"><a name="a210"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a211"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Initialise&nbsp;all&nbsp;dependancies.</span></div></li>
<li><div class="src-line"><a name="a212"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Your&nbsp;Extension's&nbsp;init()&nbsp;method&nbsp;MUST&nbsp;call&nbsp;this&nbsp;method&nbsp;first&nbsp;and&nbsp;return</span></div></li>
<li><div class="src-line"><a name="a213"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;FALSE&nbsp;if&nbsp;it&nbsp;fails.</span></div></li>
<li><div class="src-line"><a name="a214"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a215"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">final&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodinitDependancies">initDependancies</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a216"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a217"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Gather&nbsp;dependancies&nbsp;and&nbsp;inititialise&nbsp;them&nbsp;all</span></div></li>
<li><div class="src-line"><a name="a218"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$success&nbsp;</span>=&nbsp;<span class="src-id">TRUE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a219"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../Buan/Extension.html#var$dependancies">dependancies</a>&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$dependancy</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a220"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$E&nbsp;</span>=&nbsp;<span class="src-id"><a href="../Buan/Extension.html">Extension</a></span><span class="src-sym">::</span><a href="../Buan/Extension.html#methodgetExtensionByName">getExtensionByName</a><span class="src-sym">(</span><span class="src-var">$dependancy</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a221"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$E</span><span class="src-sym">-&gt;</span><a href="../Buan/Extension.html#methodinit">init</a><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a222"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$success&nbsp;</span>=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a223"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a224"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a225"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a226"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Result</span></div></li>
<li><div class="src-line"><a name="a227"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$success</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a228"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a229"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a230"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a231"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Abstract&nbsp;methods,&nbsp;all&nbsp;of&nbsp;which&nbsp;MUST&nbsp;be&nbsp;implemented&nbsp;by&nbsp;each&nbsp;Extension.</span></div></li>
<li><div class="src-line"><a name="a232"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a233"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a234"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a235"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;array&nbsp;getButtonmanagerMap()</span></div></li>
<li><div class="src-line"><a name="a236"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a237"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Generates&nbsp;and&nbsp;returns&nbsp;a&nbsp;list&nbsp;of&nbsp;buttons&nbsp;that&nbsp;are&nbsp;displayed&nbsp;in&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a238"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Extension&nbsp;Manager&nbsp;interface.</span></div></li>
<li><div class="src-line"><a name="a239"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;This&nbsp;mapping&nbsp;allows&nbsp;the&nbsp;Extension&nbsp;author&nbsp;to&nbsp;map&nbsp;a&nbsp;GUI&nbsp;button&nbsp;element&nbsp;in</span></div></li>
<li><div class="src-line"><a name="a240"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;the&nbsp;front-end&nbsp;to&nbsp;a&nbsp;method&nbsp;in&nbsp;their&nbsp;Extension&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a241"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a242"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;The&nbsp;format&nbsp;of&nbsp;the&nbsp;returned&nbsp;array&nbsp;is:</span></div></li>
<li><div class="src-line"><a name="a243"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;$result&nbsp;=&nbsp;array(</span></div></li>
<li><div class="src-line"><a name="a244"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0=&gt;array(</span></div></li>
<li><div class="src-line"><a name="a245"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'method'=&gt;'class-method-to-be-called',</span></div></li>
<li><div class="src-line"><a name="a246"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'=&gt;'button-label'</span></div></li>
<li><div class="src-line"><a name="a247"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),</span></div></li>
<li><div class="src-line"><a name="a248"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</span></div></li>
<li><div class="src-line"><a name="a249"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;);</span></div></li>
<li><div class="src-line"><a name="a250"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a251"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">abstract&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodgetManagerButtonMap">getManagerButtonMap</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a252"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a253"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a254"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;bool&nbsp;isInstalled()</span></div></li>
<li><div class="src-line"><a name="a255"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a256"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Perform&nbsp;some&nbsp;checks&nbsp;to&nbsp;see&nbsp;if&nbsp;the&nbsp;Extension&nbsp;is&nbsp;already&nbsp;installed.</span></div></li>
<li><div class="src-line"><a name="a257"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Return&nbsp;TRUE&nbsp;is&nbsp;if&nbsp;it's&nbsp;installed,&nbsp;or&nbsp;FALSE&nbsp;otherwise.</span></div></li>
<li><div class="src-line"><a name="a258"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a259"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">abstract&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodisInstalled">isInstalled</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a260"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a262"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;bool&nbsp;install()</span></div></li>
<li><div class="src-line"><a name="a263"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a264"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Contains&nbsp;the&nbsp;installation&nbsp;routine.</span></div></li>
<li><div class="src-line"><a name="a265"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a266"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">abstract&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodinstall">install</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a267"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a268"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a269"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;bool&nbsp;uninstall()</span></div></li>
<li><div class="src-line"><a name="a270"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a271"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Contains&nbsp;the&nbsp;uninstallation&nbsp;routine.</span></div></li>
<li><div class="src-line"><a name="a272"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">abstract&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methoduninstall">uninstall</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a274"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a275"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a276"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;@method&nbsp;bool&nbsp;init()</span></div></li>
<li><div class="src-line"><a name="a277"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a278"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;This&nbsp;allows&nbsp;the&nbsp;Extension&nbsp;to&nbsp;perform&nbsp;some&nbsp;intitialising&nbsp;routines&nbsp;during</span></div></li>
<li><div class="src-line"><a name="a279"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;the&nbsp;environment&nbsp;setup.&nbsp;These&nbsp;are&nbsp;all&nbsp;run&nbsp;prior&nbsp;to&nbsp;the&nbsp;application's</span></div></li>
<li><div class="src-line"><a name="a280"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;bootstrap&nbsp;script&nbsp;(see&nbsp;note&nbsp;below).</span></div></li>
<li><div class="src-line"><a name="a281"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a282"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Return&nbsp;TRUE&nbsp;on&nbsp;successful&nbsp;initialisation,&nbsp;or&nbsp;FALSE&nbsp;otherwise.</span></div></li>
<li><div class="src-line"><a name="a283"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a284"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Your&nbsp;implementation&nbsp;of&nbsp;this&nbsp;MUST&nbsp;call&nbsp;&quot;$this-&gt;initDependancies()&quot;&nbsp;before</span></div></li>
<li><div class="src-line"><a name="a285"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;anything&nbsp;else&nbsp;and&nbsp;return&nbsp;FALSE&nbsp;if&nbsp;that&nbsp;call&nbsp;returns&nbsp;FALSE.&nbsp;ie:</span></div></li>
<li><div class="src-line"><a name="a286"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;if(!$this-&gt;initDependancies())&nbsp;{</span></div></li>
<li><div class="src-line"><a name="a287"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;FALSE;</span></div></li>
<li><div class="src-line"><a name="a288"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a289"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a290"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Common&nbsp;tasks&nbsp;that&nbsp;an&nbsp;initialisation&nbsp;routine&nbsp;would&nbsp;perform&nbsp;are:</span></div></li>
<li><div class="src-line"><a name="a291"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;-&nbsp;Define&nbsp;new&nbsp;ModelRelations&nbsp;for&nbsp;any&nbsp;Models&nbsp;that&nbsp;the&nbsp;Extension&nbsp;introduces</span></div></li>
<li><div class="src-line"><a name="a292"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;-&nbsp;Add&nbsp;Model&nbsp;and&nbsp;Manager&nbsp;directory&nbsp;paths&nbsp;to&nbsp;the&nbsp;BuanAutoLoader</span></div></li>
<li><div class="src-line"><a name="a293"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;-&nbsp;Define&nbsp;Config&nbsp;variables&nbsp;to&nbsp;be&nbsp;used&nbsp;by&nbsp;certain&nbsp;scripts&nbsp;in&nbsp;the&nbsp;extension</span></div></li>
<li><div class="src-line"><a name="a294"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a295"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;IMPORTANT&nbsp;NOTE:</span></div></li>
<li><div class="src-line"><a name="a296"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Do&nbsp;NOT&nbsp;start&nbsp;a&nbsp;session&nbsp;within&nbsp;this&nbsp;method.&nbsp;For&nbsp;example,&nbsp;if&nbsp;the&nbsp;application</span></div></li>
<li><div class="src-line"><a name="a297"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;is&nbsp;storing&nbsp;some&nbsp;custom&nbsp;object&nbsp;instances&nbsp;in&nbsp;the&nbsp;session,&nbsp;then&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a298"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;bootstrap&nbsp;script&nbsp;will&nbsp;probably&nbsp;be&nbsp;adding&nbsp;some&nbsp;paths&nbsp;to&nbsp;the&nbsp;BuanAutoLoader</span></div></li>
<li><div class="src-line"><a name="a299"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;mechanism.&nbsp;However,&nbsp;if&nbsp;you&nbsp;start&nbsp;a&nbsp;session&nbsp;before&nbsp;these&nbsp;paths&nbsp;have&nbsp;been</span></div></li>
<li><div class="src-line"><a name="a300"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;added&nbsp;then&nbsp;those&nbsp;stored&nbsp;instances&nbsp;will&nbsp;never&nbsp;be&nbsp;woken&nbsp;up&nbsp;correctly.&nbsp;This</span></div></li>
<li><div class="src-line"><a name="a301"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;is&nbsp;because&nbsp;each&nbsp;extension's&nbsp;init()&nbsp;method&nbsp;is&nbsp;called&nbsp;BEFORE&nbsp;the&nbsp;bootstrap</span></div></li>
<li><div class="src-line"><a name="a302"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;file.</span></div></li>
<li><div class="src-line"><a name="a303"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a304"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Instead,&nbsp;just&nbsp;let&nbsp;the&nbsp;application&nbsp;developer&nbsp;know&nbsp;that&nbsp;your&nbsp;extension</span></div></li>
<li><div class="src-line"><a name="a305"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;requires&nbsp;a&nbsp;session&nbsp;to&nbsp;be&nbsp;started&nbsp;so&nbsp;they&nbsp;can&nbsp;do&nbsp;this&nbsp;in&nbsp;their&nbsp;bootstrap</span></div></li>
<li><div class="src-line"><a name="a306"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;script.</span></div></li>
<li><div class="src-line"><a name="a307"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#</span></div></li>
<li><div class="src-line"><a name="a308"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;If&nbsp;you&nbsp;need&nbsp;to&nbsp;access&nbsp;data&nbsp;held&nbsp;within&nbsp;$_SESSION&nbsp;during&nbsp;initialisation,</span></div></li>
<li><div class="src-line"><a name="a309"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;then&nbsp;it's&nbsp;suggested&nbsp;that&nbsp;you&nbsp;create&nbsp;a&nbsp;custom&nbsp;method&nbsp;that&nbsp;does&nbsp;this&nbsp;and</span></div></li>
<li><div class="src-line"><a name="a310"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;then&nbsp;ask&nbsp;the&nbsp;application&nbsp;developer&nbsp;to&nbsp;simply&nbsp;call&nbsp;this&nbsp;method&nbsp;in&nbsp;their</span></div></li>
<li><div class="src-line"><a name="a311"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;bootstrap&nbsp;script&nbsp;(after&nbsp;they&nbsp;have&nbsp;started&nbsp;the&nbsp;session),&nbsp;like&nbsp;so:</span></div></li>
<li><div class="src-line"><a name="a312"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;$ext&nbsp;=&nbsp;Extension::getExtensionByName('my-extension');</span></div></li>
<li><div class="src-line"><a name="a313"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;$ext-&gt;customMethod();</span></div></li>
<li><div class="src-line"><a name="a314"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a315"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">abstract&nbsp;</span><span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Buan/Extension.html#methodinit">init</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a316"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a317"></a><span class="src-php">?&gt;</span></div></li>
</ol>
</span></div>
        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Tue, 04 Aug 2009 19:58:59 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>